<?php
// define constant of user type
define("USER",1);  
define("ADMIN",2); 

define("HOT_PROPERTY",2); 
define("FEATURE_PROPERTY",3); 

error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', 1);
date_default_timezone_set('Europe/London'); 
// directory setup and class loading
$applicationDir = dirname(__FILE__);
set_include_path('.' . PATH_SEPARATOR . $applicationDir.'/library/'
     . PATH_SEPARATOR . $applicationDir.'/application/models'     
     . PATH_SEPARATOR . get_include_path()); 
	 
include "Zend/Loader.php";
Zend_Loader::registerAutoload();
//create new instance object of Zend_Registry
$registry = Zend_Registry::getInstance(); 
//load the setting of application
$appSetting = new Zend_Config_Ini($applicationDir.'/application/config.ini', 'settings');
$registry->set('appSetting', $appSetting);

// load configuration
$config = new Zend_Config_Ini($applicationDir.'/application/config.ini', $appSetting->test->defaultdb);
$configLayout = new Zend_Config_Ini($applicationDir.'/application/config.ini', 'layout');
$configLanguage = new Zend_Config_Ini($applicationDir.'/application/config.ini', 'language');

//registry config value 
$registry->set('config', $config);
$registry->set('configLayout', $configLayout);  
$registry->set('configLanguage', $configLanguage);
$registry->set('baseUrl', $appSetting->test->baseurl); 

// setup database 
$myDb = Zend_Db::factory($config->test->db);
Zend_Db_Table::setDefaultAdapter($myDb);  
?>
